package com.example.administrator.baikangxing.holder;

import android.view.View;
import android.widget.TextView;

import com.example.administrator.baikangxing.MyApplication;
import com.example.administrator.baikangxing.R;
import com.example.administrator.baikangxing.bean.ContactUser;
import com.example.administrator.baikangxing.view.CircleImageView;


public class CallContactHolder extends BaseHolder<ContactUser> {

    private CircleImageView head;
    private TextView number;
    private TextView name;

    @Override
    protected View getHolderView() {
        View view = View.inflate(MyApplication.context, R.layout.contact_item, null);
        name = (TextView) view.findViewById(R.id.contact_tv_name);
        head = (CircleImageView) view.findViewById(R.id.contact_image_head);
        number = (TextView) view.findViewById(R.id.contact_tv_number);
        return view;
    }

    @Override
    public void bindData(ContactUser contactUser) {
        name.setText(contactUser.getName());
        number.setText(contactUser.getNumber());
        head.setImageResource(contactUser.getPic());
    }
}
